<%= form_for(@prescription, url:
		if action_name == "new"
			appointment_prescriptions_path
		else
			appointment_prescription_path
		end
) do |f| %>
  <% if @prescription.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@prescription.errors.count, "error") %> prohibited this prescription from being saved:</h2>

      <ul>
      <% @prescription.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :drug_id %><br>
    <%= collection_select(:prescription, :drug_id, Drug.all, :id, :name, prompt: true) %>
  </div>
  <div class="field">
    <%= f.label :dosage %><br>
    <%= f.text_field :dosage %>
  </div>
  <div class="field">
    <%= f.label :quantity %><br>
    <%= f.text_field :quantity %>
  </div>
  <div class="field">
    <%= f.label :fee %><br>
    <%= f.text_field :fee %>
  </div>
  <div class="field">
    <%= f.label :note %><br>
    <%= f.text_area :note %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
